package main

import (
	"yundian/internel/app/logic"
	. "yundian/internel/pkg/dbs"
	. "yundian/internel/pkg/dingo"
	"yundian/internel/pkg/dingo/system"
)

// -------------------------- 完结订单定时任务 ----------------------------------- //

func main() {
	TaskSystem := system.New("./configs/adm.yaml").
		Ready(
			NewZapComponent(),   // logger 日志管理
			NewMysqlComponent(), // mysql 连接
			NewRedisComponent(), // redis 连接
			NewTransComponent(), // validator 翻译器
		)

	TaskSystem.Task("0 0/1 * * * *", func() {
		logic.NewTaskLogic().AutoCompleteMemberOrderByWx("hnxm", 1)
	})
	TaskSystem.Task("10 0/1 * * * *", func() {
		logic.NewTaskLogic().AutoCompleteMemberOrderByWx("hnxm", 2)
	})
	TaskSystem.Task("20 0/1 * * * *", func() {
		logic.NewTaskLogic().AutoCompleteMemberOrderByWx("hnxm", 3)
	})

	TaskSystem.Task("40 0/1 * * * *", func() {
		logic.NewTaskLogic().AutoCompleteMemberOrderLastTwoDays()
	})

	TaskSystem.Go()
}
